package com.gcsoftware.web.beans.returnPage;

import java.io.Serializable;
import java.util.Objects;

/**
 * 聚合分组
 * @author czp
 * date : 2018-04-09
 */
public class Buckets implements Serializable {
    private String key;
    private long doc_count;

    public Buckets() {
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Buckets)) {
            return false;
        }
        Buckets buckets = (Buckets) obj;
        if (buckets.key.equals(this.key) && buckets.getDoc_count() == this.getDoc_count()) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {

        return Objects.hash(key, doc_count);
    }

    public Buckets(String key, long doc_count) {
        this.key = key;
        this.doc_count = doc_count;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public long getDoc_count() {
        return doc_count;
    }

    public void setDoc_count(long doc_count) {
        this.doc_count = doc_count;
    }
}
